import 'babel-polyfill'

import Vue                   from 'vue'
import iView                 from 'iview'
import router,{bindStore}    from '@/router'
import store                 from '@/store'
import {mapActions,mapState} from 'vuex'
import base          				 from '@/components/base'

import '@/assets/styles/style.less'
iView.Modal.props.maskClosable.default = false;
// iView.Select.props.transfer.default = true;
iView.Input.props.maxlength.default = 30;
Vue.use(iView)
Vue.use(base)
Vue.config.productionTip = false

window.onresize = ()=>store.dispatch("base/resize")

AMapUI.loadUI([
	'misc/PathSimplifier',
	'overlay/SimpleMarker',
	'overlay/AwesomeMarker',
	'geo/DistrictCluster'
	],
function(PathSimplifier, SimpleMarker, AwesomeMarker, DistrictCluster){
	// 全局注册高德地图UI组件
	window.PathSimplifier = PathSimplifier;
	window.SimpleMarker 	= SimpleMarker;
	window.AwesomeMarker	= AwesomeMarker;
	window.DistrictCluster = DistrictCluster;

	const app = new Vue({
		store,
		router,
	  el: '#app',
	  template:`<div id="app" :class="{'isLoading':isLoading}"><router-view/></div>`,
	  computed:{
	  	...mapState('base',['isLoading'])
	  }
	})
});
